package cn.gaily.eduservice.controller;

import cn.gaily.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

@Api(description = "登录接口")
@RestController
@RequestMapping("eduservice/user")
@CrossOrigin//允许跨域
public class EduLoginController {

    @ApiOperation("登录接口")
    @PostMapping("login")
    public R login(){
        return R.ok().data("token","admin");
    }

    @ApiOperation("info返回信息")
    @GetMapping("info")
    public R info(){
        return R.ok().data("name","xcw")
                .data("avatar","https://xcw-edu.oss-cn-beijing.aliyuncs.com/2021/06/30/a2964beb5c2046eba322595396367d25file.png")
                .data("roles","[admin]");
    }
}
